#ifndef _WS2812_H_
#define _WS2812_H_
#include <stdint.h>



#define LED_NUM 50
#define LED_BUF_LEN LED_NUM*24+16
typedef struct 
{
    uint8_t R;
    uint8_t G;
    uint8_t B;
}RGB_Color_Type_t;

/*************呼吸灯句柄*******************/
typedef struct 
{     
    uint8_t               dir;           //方向
    float                 step;          //步长
    float                 brightness; 
    uint8_t               max;          //最大亮度
    uint8_t               min;          //最小亮度
    RGB_Color_Type_t      color;        //颜色
}BreatheLight_Handle_Type_t;
/*************闪灯控制*******************/
typedef struct 
{     
    uint16_t               period;         //闪烁周期,毫秒
    uint16_t               Open_Pulse;     //步长
	  uint16_t               step_time;      //   ms
    uint16_t               time;           //   ms
    RGB_Color_Type_t       color;        //颜色
}Blink_Handle_Type_t;
/***************灯控制*******************/
typedef struct
{
	  uint8_t               model;
	  RGB_Color_Type_t      color;        //颜色
}Light_Hande_Type_t;
/***********灯模式*************/
typedef enum
{
	  Breathe=1,
	  blink=2,
	  Light_NO=3,
	  Light_close=4,
}Light_Model;

extern RGB_Color_Type_t R_color;
extern RGB_Color_Type_t B_color;
extern RGB_Color_Type_t G_color;
extern RGB_Color_Type_t Y_color;
extern uint8_t led_buf[LED_BUF_LEN];
void SET_NColor(uint8_t n,uint8_t Red,uint8_t Green,uint8_t Blue);
void SET_Color(uint8_t Red,uint8_t Green,uint8_t Blue);

void Set_Blink_Light(RGB_Color_Type_t color);
void Set_breathe_Light(RGB_Color_Type_t color);

void Set_Light(uint8_t model,RGB_Color_Type_t color);
#endif
